package components.dialogs
{
	import SEApp.dialogs.se_dialog;
	import SEApp.se_eventManager;
	
	import UIFree.controls.uif_button;
	import UIFree.uif_component;
	
	import components.clt_component;
	
	import flash.geom.Rectangle;

	public class clt_dialog extends se_dialog {
		private var _buttonLayer: clt_component;
		public static var BUTTONWIDTH: Number = 120;
		public static var BUTTONHEIGHT: Number = 33;
		
		public function clt_dialog(parent:uif_component, ax:int=0, ay:int=0, awidth:int=0, aheight:int=0, asModal:Boolean=false, canClose:int=2) {
			super(parent, ax, ay, awidth, aheight, asModal, canClose);
		}
		
		public function get workspace(): se_eventManager {
			return (app as Object).workspace;
		} 
		
		public function get clt(): clt_clothingBase {
			return app as clt_clothingBase;
		}
		
		protected function addButton(caption: String, doClick: Function): uif_button {
			var inner: Rectangle = getInner();
			if (!_buttonLayer) {
				_buttonLayer = new clt_component(this, inner.x, inner.y + inner.height - BUTTONHEIGHT, 0, BUTTONHEIGHT); 
			}
			var button: uif_button = clt_clothingBase.button(_buttonLayer, _buttonLayer.numChildren * BUTTONWIDTH,0, BUTTONWIDTH, BUTTONHEIGHT, caption, doClick);
			_buttonLayer.width = _buttonLayer.numChildren * BUTTONWIDTH;
			_buttonLayer.x = inner.x + (inner.width - _buttonLayer.width) / 2;
			return button;
		}
	}
}